-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zoom-out: Move default background to the iframe component #66284
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +29 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
@@ -6,4 +6,5 @@ iframe[name="editor-canvas"] { | |||
background-color: transparent; | |||
// Handles transitions between device previews | |||
@include editor-canvas-resize-animation; | |||
background-color: $gray-300; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember exactly, but I think we wanted to have transparent
background (now you have two background-color
rules). Maybe something with the background in theme.json if defined? 🤔 Of course if that was the reason, block editor shouldn't have that dependency..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it seems this introduced the issue in #62223 back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the issue seems in trunk too, so there must be something else going on. The regression is not caused by this PR. cc @jasmussen
Given that the animation issue is also in trunk, I think we should consider shipping this PR. WDYT |
Btw, there's also this that is related: #60873 I feel like we're adding and removing this in a loop 😄 |
💯 |
@jameskoster if you have bandwidth, can you take a look at what's up here? |
This one exists in trunk too in my testing. |
I can't reproduce this one. Is it in all themes, all browsers? any specifics? |
I fixed this one in the last commit. |
WDYT @jameskoster |
We can add a rule for that. but I'm going to count on you to test because I don't see it :) |
@jameskoster I added a potential fix, let me know if it works for you. |
That fixed it :) |
Flaky tests detected in 9c92370. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11498902167
|
527216c
to
9c92370
Compare
I could use an approval here. |
|
||
// This duplicates the iframe background but it's necessary in some situations | ||
// when the iframe doesn't cover the whole canvas | ||
// like the "focused entities". | ||
background-color: $gray-300; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have this rule, why do we still need the background in packages/block-editor/src/components/block-canvas/style.scss
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For third-party block editor usage. (zoom-out in storybook for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤞 This is good for a while 😄
…66284) Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
What?
When you trigger zoom-out, the iframe content is scaled down revealing some empty space on the right/left of the document. In both site editor and post editors, there's a background color applied to this area that "blends" with the frame size of the zoom-out. That said, if you're triggering zoom-out in a third-party block editor (like the storybook story), that space remains "white".
This PR moves that background style to the iframe component that way it's applied by default to all iframes and all block editors.
It solves this comment #66240 (comment)
Testing Instructions
1- There should be no background changes in the editor in zoom-out mode or not.
2- zoom-out background is still correct in the storybook story even without the extra style.